package view;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class RenderCell extends DefaultTableCellRenderer{
	
	/**
	 * 
	 */
	
	private long rowPc;
	
	public RenderCell(long rowPc){
		super();
		this.rowPc = rowPc;
	}
	
	private static final long serialVersionUID = 1L;


    public Component getTableCellRendererComponent (JTable table, 
        Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
    	
    	Component c = super.getTableCellRendererComponent(table, obj, isSelected, hasFocus, row, column);

        if (row == rowPc){ 
        	c.setForeground(Color.white);
        	c.setBackground(Color.GRAY);
        	c.setFont(new Font(c.getFont().getFontName(), Font.BOLD, c.getFont().getSize()));
        }
        else{
        	c.setForeground(Color.black);
        	c.setBackground(null);
        	c.setFont(new Font(c.getFont().getFontName(), Font.PLAIN, c.getFont().getSize()));
        }
        
        
        return c;
    }

}
